%% simulation of the micro doppler echo of the rotating blade
function echo = mdMeasEcho_new(lightSpeed, carrFreq,...
    bladeNums, bladeLen, bladePhase,...
    dopplerPhase, dopplerAmp)
% ---------------------------------------------------
% 用于产生指定时刻单个单元格内的螺旋桨回波
% echo = mdMeasEcho(bladeNums, bladeLen,...
% bladeRate, lightSpeed, bladePhase,...
% dopplerPhase, dopplerAmp)
% ---------输入---------
% lightSpeed 为光速，请设为3e8
% carrFreq 为雷达载波频率
% bladeNums 为叶片数量
% bladeLen 为叶片长度，单位：米
% bladePhase 为微多普勒的瞬时相位，体现为叶片的瞬时相位
% dopplerPhase 为主体回波多普勒的瞬时相位
% dopplerAmp 为主体回波的强度，微多普勒的强度默认为1，通过修改该值可以修改
%            主体回波与微多普勒散射点回波的强度比
% ---------输出---------
% echo 雷达回波，若输入为时间点，则为一个值，若输入为时间序列，则为一行值
% ---------------------------------------------------
    % data verify
    dataValid = true;
    dataValid = dataValid && (length(lightSpeed) == 1);
    dataValid = dataValid && (length(carrFreq) == 1);
    dataValid = dataValid && (length(bladeNums) == 1);
    dataValid = dataValid && (length(bladeLen) == 1);
    dataValid = dataValid && (length(bladePhase) == 1);
    dataValid = dataValid && (length(dopplerPhase) == 1);
    dataValid = dataValid && (length(dopplerAmp) == 1);
    
    if ~dataValid
        error('请确保输入量为单值');
    end
    bladeAng  = (0 : (bladeNums - 1)) * 2 * pi / bladeNums;
    mDopAmp = (4 * pi * bladeLen * carrFreq) / lightSpeed;     % 这项调控微动震荡幅度，与叶片线速度相关
    % generate echo
    echo = dopplerAmp;    % 直流分量
    bladeEcho = exp(mDopAmp * 1j * cos(bladePhase + bladeAng));  % 各螺旋桨回波
    echo = echo + sum(bladeEcho, 'all');
    echo = exp(-1j * dopplerPhase) .* echo / (bladeNums + dopplerAmp);
end